<template>
  <div class="app-main">
    <router-view></router-view>
  </div>
</template>

<script>
import { mapState } from 'vuex';
export default {
  data() {
    return {};
  },
  computed: {
    ...mapState({
      lineBroadcas: (state) => state.resource.lineBroadcas
    }),
  },
  watch: {
    lineBroadcas: {
      deep: true,
      handler: function (val) {
        if (val) {
          if(val.type === 'part'){
            if(val.data)this.$hubClient.sendCreatePart(val.data);
          }else if(val.type === 'layout'){
            if(val.data)this.$hubClient.sendLayout(val.data)
          }
        }
      },
    },
  },
  created() {
    setTimeout(() => {
      this.$hubClient.enable=true;
      setTimeout(() =>this.$hubClient.sendRegisterClient(), 500);
    }, 1500);
  },
  methods: {

  }
};
</script>
<style lang="less">
  .app-main{
    width: 100%;
    height: 100%;
  }
</style>